package com.tool.btn;

import com.tool.role.RoleData;
import com.tool.tcpimg.UIUtils;
import java.awt.Color;
import java.awt.event.MouseEvent;
import org.come.Frame.GoodDetailedJframe;
import org.come.Frame.ZhuFrame;
import org.come.model.Eshop;
import org.come.until.FormsManagement;
import org.come.until.Util;

public class ShopBuyBtn extends MoBanBtn {
    private int caozuo;
    private Eshop eshop;

    public ShopBuyBtn(String iconpath, int type, String text, int caozuo, Eshop eshop) {
        super(iconpath, type);
        this.caozuo = caozuo;
        this.eshop = eshop;
        this.setText(text);
        this.setFont(UIUtils.TEXT_FONT);
        this.setForeground(Color.white);
        this.setVerticalTextPosition(0);
        this.setHorizontalTextPosition(0);
    }

    @Override
    public void chooseyes() {
    }

    @Override
    public void chooseno() {
    }

    @Override
    public void nochoose(MouseEvent e) {
        switch(this.caozuo) {
        case 1:
            if (this.eshop == null) {
                return;
            } else if (!Util.canBuyOrno) {
                ZhuFrame.getZhuJpanel().addPrompt2("#G背包没有解锁!!");
                FormsManagement.showForm(33);
                return;
            }  else {
                GoodDetailedJframe.getGoodDetailedJframe().getGoodDetailedJpanel().gainGoodsMessage(this.eshop);
                FormsManagement.showForm(44);
            }
        default:
        }
    }

    public int getCaozuo() {
        return this.caozuo;
    }

    public void setCaozuo(int caozuo) {
        this.caozuo = caozuo;
    }

    public Eshop getEshop() {
        return this.eshop;
    }

    public void setEshop(Eshop eshop) {
        this.eshop = eshop;
    }
}
